home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_olv_whipstrut_attack.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  164 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # OLV_Commie_Grid.cog
  5. # Cog to control the AI and patrol behavior of the commies in the Olmec Valley
  6. #
  7. # [JM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.  
  16. message         startup 
  17. message         entered
  18. message         arrivedwpnt
  19. message         killed
  20.  
  21. # ================================== SUBROUTINES =========================================
  22.  
  23. flex            StartAttack         local
  24.  
  25. # =============================== WORLD REFERENCES =======================================
  26.  
  27. surface         Start               
  28. surface         BackTrack              
  29.  
  30. # ============================= MISC LOCAL VARIABLES =====================================
  31.  
  32. int             counter             local
  33. int             HasBegunCheck=0     local
  34. int             GuardsAwake=0       local
  35.  
  36. int             DeathFromAboveCheck=0   local
  37.  
  38. int             Currentwpnt         local
  39.  
  40. # =================================== CONSTANTS ==========================================
  41.  
  42. int             NUMBER_OF_COMMIES_TOTAL=4   local
  43. int             NUMBER_OF_GUARDS=2          local
  44.  
  45. # ==================================== COMMIES ===========================================
  46.  
  47. AI              AI_Sniper=com_2Hsniper.ai   local
  48.  
  49. thing           TempCommie                  local
  50.  
  51. #thing           SniperBackup
  52. #thing           GrenadeChucker
  53.  
  54. thing           SniperOne
  55.  
  56. thing           GunnerOne
  57.  
  58. thing           Guard00
  59. thing           Guard01
  60.  
  61. # ===================================== SOUNDS ===========================================
  62.  
  63. thing           SoundGhost  
  64.  
  65. sound           Chatter00=inxh3016.wav      local
  66. sound           Chatter01=inxh4004.wav      local
  67. sound           Chatter02=inxh3002.wav      local
  68.  
  69. # ========================================================================================
  70. end
  71. # ========================================================================================
  72. # ==================================== CODE ==============================================
  73. # ========================================================================================
  74. code
  75. # ========================================================================================
  76. startup:
  77.  
  78.     for(counter = 0; counter < NUMBER_OF_COMMIES_TOTAL; counter = counter + 1)
  79.     {
  80.         SetThingFlags(SniperOne[counter], 0x80000);
  81.         AISetCutsceneMode(SniperOne[counter]);
  82.     }                  
  83.         
  84.     return;
  85.     
  86. # ========================================================================================
  87. entered:
  88.  
  89.     if(GetSenderRef() == Start && HasBegunCheck == 0)
  90.     {                                     
  91.         HasBegunCheck = 1;
  92.         Call StartAttack;
  93.     }                     
  94.     
  95.     else if(GetSenderRef() == BackTrack && HasBegunCheck == 1 && GuardsAwake == 0)
  96.     {
  97.         GuardsAwake = 1;
  98.         AIClearCutsceneMode(Guard00);
  99.         AIClearCutsceneMode(Guard01);
  100.     }
  101.     
  102.     return;
  103.     
  104. # ========================================================================================
  105. arrivedwpnt:              
  106.         
  107.     if(GetSenderRef() == GunnerOne)  
  108.     {
  109.         if(GetParam(0) == 43)
  110.         {
  111.             AIClearCutsceneMode(GunnerOne);
  112.         }
  113.     }
  114.     
  115.     else if(GetSenderRef() == SniperOne) 
  116.     {                 
  117.         if(GetParam(0) == 42)
  118.         {
  119.             AISetClass(SniperOne, AI_sniper);
  120.             AIClearCutsceneMode(SniperOne);
  121.         }
  122.     }
  123.  
  124.     return;
  125.  
  126.     
  127. # ========================================================================================
  128. killed:
  129.  
  130.     TempCommie = GetSenderRef();
  131.     
  132.     if(TempCommie == SniperOne) SniperOne = -1;
  133.     if(TempCommie == GunnerOne) GunnerOne = -1;
  134.  
  135.     return;
  136.     
  137. # =============================== SUBROUTINES ============================================
  138. StartAttack:
  139.  
  140.     PlaySoundThing(Chatter00, SoundGhost, 1.0, 5, 25, 0);
  141.     sleep(1.5);
  142.     PlaySoundThing(Chatter01, SoundGhost, 1.0, 8, 25, 0);
  143.     
  144.     ClearThingFlags(SniperOne, 0x80000);
  145.     ClearThingFlags(GunnerOne, 0x80000);
  146.     ClearThingFlags(Guard00, 0x80000);
  147.     ClearThingFlags(Guard01, 0x80000);
  148.     
  149.     AITraverseWpnts(GunnerOne, 43, 2.0, 20.0, 0);
  150.         
  151.     sleep(1.5);                                           
  152.     PlaySoundThing(Chatter02, SoundGhost, 1.0, 12, 30, 0);
  153.     #sleep(1.5);
  154.     
  155.     AITraverseWpnts(SniperOne, 41, 2.0, 20.0, 0);
  156.                         
  157.     return;
  158.     
  159. # ========================================================================================
  160. end
  161.  
  162.